<template>
  <div class='add-subjects'>
     <!-- 新增学科弹出层 -->
            <template>
              <el-form :inline="true"  class="demo-form-inline">
                   <el-form-item label="学科名称">
                   <el-input   v-model="subjectName"></el-input>
                  </el-form-item>
                   <el-switch
                      v-model="isdisplay"
                       active-color="#13ce66"
                      inactive-text="是否显示">
                  </el-switch>
              </el-form>

            </template>
            <div class="btn">
                <span slot="footer" class="dialog-footer">
                   <el-button @click="$emit('close')">取 消</el-button>
                   <el-button type="primary" @click="add">确 定</el-button>
                </span>
            </div>

       <!-- 新增学科弹出层 -->
  </div>
</template>

<script>

export default {
  naem: 'subjectsAdd',
  props: {
    channe: {
      type: String
    }

  },
  data () {
    return {
      isdisplay: true,
      subjectName: this.channe,
      isaddshow: false
    }
  },
  methods: {
    add () {
      const addname = {
        name: this.subjectName,
        addshow: this.isaddshow,
        display: this.isdisplay
      }
      if (this.channe) {
        this.$emit('input', addname)
      } else {
        console.log(addname)
        this.$emit('add', addname)
      }
    }

  }
}
</script>

<style scoped lang='scss'>
.btn{
  margin: 20px;
}
</style>
